﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace $safeprojectname$
{
    public class MappingDescription : IMappingDescription
    {
        public virtual string PropertyName { get; set; }
        public virtual string PersistenceName { get; set; }
        public virtual bool CanInsert { get; set; }
        public virtual bool CanUpdate { get; set; }
        public virtual PropertyInfo PropertyInfo { get; set; }
        public virtual Type PropertyType
        {
            get { return PropertyInfo.Is() ? PropertyInfo.PropertyType : null; } 
        }

        public virtual bool IsDynamic { get; set; }
        public virtual IList<IMappingDescription> DynamicComponents { get; set; }

        public override string ToString()
        {
            return PropertyName + " (" + PersistenceName + ")";
        }
    }

    public class DynamicDescription : IMappingDescription
    {
        public virtual string PropertyName { get; set; }
        public virtual string PersistenceName { get; set; }
        public virtual bool CanInsert { get; set; }
        public virtual bool CanUpdate { get; set; }
        public virtual Type PropertyType { get; set; }

        public override string ToString()
        {
            return PropertyName + " (" + PersistenceName + ")";
        }
    }
}
